import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/org',
    method: 'GET',
    params: query
  })
}

export function fetchOrg(query) {
	return request({
		url: `/org/GetAllOrgByTenant/${query}`,
		method: 'GET'
	})
}

export function getOrg(id){
	return request({
		url: `/org/${id}`,
		method: 'GET'
	})
}

export function saveOrg(data){
	return request({
		url: '/org',
		method: 'POST',
		data
	})
}

export function deleteOrg(id){
	return request({
		url:`/org/${id}`,
		method: 'DELETE'
	})
}

export function updateOrg(data){
	return request({
		url: `/org/${data.Id}`,
		method: 'PUT',
		data
	})
}